import http from '@/utils/request.js';
// 获取审核分类列表
export const approveType = (data) => {
	// return http.get('/business/approve/type', data);
	return http.request({
		url: '/business/approve/type',
		method: 'get',
		data
	});
};
// 获取审批列表
export const approveList = (data) => {
	// return http.get('/business/approve/page', data);
	return http.request({
		url: '/business/approve/page',
		method: 'get',
		data
	});
};
// 获取提交项目信息
export const approveDetail = (data) => {
	// return http.get('/business/approve/building/detail', data);
	return http.request({
		url: '/business/approve/building/detail',
		method: 'get',
		data
	});
};
// 获取审核统计
export const statistics = (data) => {
	// return http.get('/business/approve/user/count', data);
	return http.request({
		url: '/business/approve/user/count',
		method: 'get',
		data
	});
};

// 执行审
export const approvePlan = (data) => {
	// return http.post('/repair/business/flow/6/approve', data, 1);
	return http.request({
		url: '/repair/business/flow/6/approve',
		method: 'post',
		data,
		textJson: true,
	});
};
// 关闭 待开始 维修任务
export const closePlan = (businessApproveId, planId, closeDesc) => {
	// return http.post('/repair/business/flow/6/close?businessApproveId=' + businessApproveId + '&planId=' + planId + '&closeDesc=' + closeDesc);
	return http.request({
		url: '/repair/business/flow/6/close?businessApproveId=' + businessApproveId + '&planId=' + planId + '&closeDesc=' + closeDesc,
		method: 'post',
		textJson: true,
	});
};
// 重新分配
export const reApproveUsers = (data) => {
	// return http.post('/repair/maintain/malfunction/work/malfunctionWorkUpdate', data, 1);
	return http.request({
		url: '/repair/maintain/malfunction/work/malfunctionWorkUpdate',
		method: 'post',
		data,
		textJson: true,
	});
};
// 更新处理反馈
export const updataRemark = (data) => {
	// return http.post('/business/approve/update', data, 1);
	return http.request({
		url: '/business/approve/update',
		method: 'post',
		data,
		textJson: true,
	});
};

// 获取审批维修单详情(旧)
export const repairPlanDetail = (data) => {
	// return http.get('/repair/maintain/malfunction/work/approve/detail', data);
	return http.request({
		url: '/repair/maintain/malfunction/work/approve/detail',
		method: 'get',
		data
	});
};
// 获取审批维修单详情(新)
export const repairPlanDetailNew = (data) => {
	// return http.post('/repair/my/approve/detail', data, 1);
	return http.request({
		url: '/repair/my/approve/detail',
		method: 'post',
		data,
		textJson: true,
	});
};
// 我的申请->维修详情页催办
export const repairReminder = (data) => {
	// return http.post('/repair/business/flow/6/reminder', data, false);
	return http.request({
		url: '/repair/business/flow/6/reminder',
		method: 'post',
		data,
		textJson: false,
	});
};
// 我的申请->撤回报障
export const repairCancel = (data) => {
	// return http.post('/repair/business/flow/6/cancel', data, false);
	return http.request({
		url: '/repair/business/flow/6/cancel',
		method: 'post',
		data,
		textJson: false,
	});
};
